package com.simple.system.service;

import com.simple.system.entity.SysOptLog;
import com.simple.system.repository.SysOptLogRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class SysOptLogService {
    @Autowired
    private SysOptLogRepository operationLogRepository;

    public void saveLog(Long userId, String operationType, String operationContent) {
        SysOptLog log = new SysOptLog();
        log.setUserId(userId);
        log.setOperationType(operationType);
        log.setOperationTime(new Date());
        log.setOperationContent(operationContent);
        operationLogRepository.save(log);
    }
}    